package cn.edu.ctbu.dp001.dao;

import cn.edu.ctbu.dp001.entity.Student;
import org.springframework.data.domain.Example;
import org.springframework.data.domain.Page;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.domain.*;

import org.springframework.data.domain.Pageable;
import java.util.List;

public interface StudentRepository extends JpaRepository<Student, Integer> {
    /**
     * 按名字查询
     * @param name
     * @return
     */
    List<Student> findByNameLike(String name);

    /**
     * 按名字和密码查询
     * @param name
     * @param password
     * @return
     */
    List<Student> findByNameAndPassword(String name, String password);

    public List<Student> findBySno(String sno);

//    Page<Student> findAll(Pageable pageable);

//    Page<Student> findAll(Example<Student> example, Pageable pageable);
}

